/**
 * 
 */
package net.empego.web.dao;

import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.TypedQuery;

import net.empego.db.SiteMapEntryDO;

/**
 * @author Thomas
 * 
 */
public class SiteMapWebDAO {

	@Inject
	EntityManagerProvider emp;

	public SiteMapEntryDO findSiteMap(final String label) {

		final EntityManager emNonJta = emp.getActiveEntityManager();
		final TypedQuery<SiteMapEntryDO> createQuery = emNonJta.createQuery("from SiteMapEntryDO where label = :label", SiteMapEntryDO.class);
		createQuery.setParameter("label", label);
		return createQuery.getSingleResult();
	}

}
